package top.todu.leaning.opentelemetry_loki.controller;

import io.opentelemetry.api.trace.Span;
import java.time.LocalDateTime;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import top.todu.leaning.opentelemetry_loki.grpc.helloworld.HelloWorldClient;

@Slf4j
@RestController
public class DemoController {

  @Autowired
  private HelloWorldClient helloWorldClient;


  @GetMapping("/hello")
  public String hello() {
    return helloWorldClient.greet("hello");
  }

  //  @Scheduled(fixedRate = 1000)
  public void scheduled() {
    log.info("当前时间：{}", LocalDateTime.now());
  }
}
